import numpy as np
from mpl_toolkits import mplot3d
import matplotlib.pyplot as plt
import pandas as pd
from python_ai.common.xcommon import sep

pd.set_option('display.max_rows', None, 'display.max_columns', None, 'display.max_colwidth', 1000, 'display.expand_frame_repr', False)

a = np.array([
    [1, 2, 3],
    [4, 5, 6]
])

from sklearn.preprocessing import Binarizer
bz = Binarizer(threshold=4.5)  # ATTENTION <=4.5 => 0, >4.5 => 1
a_new = bz.fit_transform(a)
print(a)
print(a_new)